extends Area2D


var body = null

@onready var label = $"../TalkLabel"

func _ready():
	connect("body_entered", bodyEnter)
	connect("body_exited", bodyExited)


func bodyEnter(body):
	self.body = body


func bodyExited(body):
	self.body = null
	

func _physics_process(_delta):
	if body != null and body.isInteractive:
		# 添加完消息队列后, 马上将交互模式关闭
		label.addChat(["你看上去也不太强嘛", "你会在痛苦中死去"], 0.05, 0.2)
		body.isInteractive = false
